home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / s_to_z / tvalid / valid.int < prev    next >
Encoding:
Text File  |  1996-09-15  |  1.9 KB  |  65 lines

  1. {TValidator Component for Borland Delphi.
  2.  A MUST component for shareware developers.
  3.  Simplifies software validation process.
  4.  Shareware.
  5.  Version 1.0
  6.  (C) Artchil Gogava, 1995
  7.  compuserve: 75231,330
  8.  internet:   75231.330@compuserve.com}
  9.  
  10. unit Valid;
  11.  
  12. interface
  13.  
  14. uses
  15.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  16.   Forms, Dialogs, ValidDlg, ValMisc, IniFiles;
  17.  
  18. const
  19. {Name of section in .INI file}
  20.   ValSectionName = 'Validation';
  21.  
  22. type
  23.   TValidator = class(TComponent)
  24.   private
  25.     { Private declarations }
  26.     FRandSeed : LongInt;
  27.     FIniFileName : string;
  28.     FOnVldOk : TNotifyEvent;
  29.     FOnVldFailed : TNotifyEvent;
  30.     procedure DoVldOk(Sender : TObject);
  31.     procedure DoVldFailed(Sender : TObject);
  32.     procedure SetIniFileName(Value : string);
  33.     procedure UpdateValues;
  34.     procedure GetValues;
  35.   protected
  36.     { Protected declarations }
  37.     RegNumber : string;
  38.   public
  39.     { Public declarations }
  40.     UserName : string;  {is public - can be used everywhere}
  41.     constructor Create(AOwner : TComponent); override;
  42.     function IsValidated : boolean; {Checks if program has been validated}
  43.     procedure Validate; {Runs validation/registration dialog box}
  44.     procedure Devalidate; {Devalidates program}
  45.   published
  46.     { Published declarations }
  47.     property RandSeed : LongInt read FRandSeed
  48.                           write FRandSeed default 0;
  49.     {Random Seed - Used to calculate RegNumber}
  50.     property IniFileName : string read FIniFileName
  51.                           write SetIniFileName;
  52.     {Name if ini file to stare reginstration info}
  53.     property OnVldOk : TNotifyEvent read FOnVldOk
  54.                           write FOnVldOk;
  55.     {Determines what happens if validation is OK}
  56.     property OnVldFailed : TNotifyEvent read FOnVldFailed
  57.                           write FOnVldFailed;
  58.     {Determines what happens if validation failed}
  59.   end;
  60.  
  61. procedure Register;
  62.  
  63. implementation
  64.  
  65.